package com.njwb.day18.thd04;

public class MyOperator {


    public static synchronized void printAbc(){
        String msg  ="abcdefghuisadfasd";
        for(int i= 0 ;i<msg.length();i++) {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().getName()+":"+msg.charAt(i));
        }
    }


    public  synchronized void printNum(){
        String msg  ="012345678912354";
        for(int i= 0 ;i<msg.length();i++) {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println(Thread.currentThread().getName()+":"+msg.charAt(i));
        }
    }
}
